package com.example.android.supermemo.app;

import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

/**
 * Created by Dumrongrith on 8/4/2014.
 */
public class Utility {
    public static String getPreferredLanguage(Context context) {
        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
        return prefs.getString(context.getString(R.string.pref_stt_language_key),
                context.getString(R.string.pref_stt_language_default));
    }

    public static String SetLanguageTTS(String lang) {
        String result = null;
        if (lang.equals("th-TH")){
            result = "th";
        }
        else if (lang.equals("en-EN")){
            result = "en";
        }
        return result;
    }
}
